<template>
	<div id="queryForum">
		<h2 class="text-info">查看版块界面</h2>
		<div v-for="forum in forums" :key="forum.id">

			<div class="card cardSize fl">

				<div class="card-body">
					<div class="card-title">版块：
						<router-link :to="{path:'/main/queryPost',query:{id:forum.id}}">{{forum.forumName}}&nbsp;></router-link>
					</div>
					<p class="card-text">描述：{{forum.forumContent}}</p>
				</div>
			</div>

		</div>
	</div>

</template>
<script>
	export default {

		data() {
			return {

				forums: {},
				userId: ''
			}

		},
		created() {

			this.getForum();
		},
		methods: {
			getForum() {
				this.$http.get('/api/queryForum').then(data => {
					if(data.status == 200) {
						this.forums = data.body;

					}
				}, err => {
					console.log(err)
				})
			}

		}

	}
</script>

<style scoped lang="less">
	#queryForum {
		width: 650px;
		margin: 0 auto;
	}
	
	.cardSize {
		width: 300px;
		margin-top: 20px;
		margin-left: 20px;
		text-align: left;
		box-sizing: border-box;
	}
	
	a {
		color: black
	}
</style>